package my.sort;

/**
 * 休眠排序 ^-^
 *
 * @author AJun
 * @date 2020/9/19
 */
public class SleepSort extends Thread {

    private final int value;

    public SleepSort(int value) {
        this.value = value;
    }

    @Override
    public void run() {
        try {
            Thread.sleep(value);
            System.out.println(value);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        int[] array = {10, 100, 50, 30, 60};
        for (int i : array)
            new SleepSort(i).start();
    }

}
